Subject: Re: Task Priority Question
From: [email-masked] (Matthew Dillon)
Date: 4 May 1994 21:40:23 -0700
Newsgroups: comp.sys.amiga.programmer

In article <[email-masked]> [email-masked] (Lauri Aalto) writes:
:In article <[email-masked]> [email-masked] (Andrew Begg) writes:
:>What functions allow me to change the priority of my C programs so that 
:>the CPU gives more (or, perhaps, all) of its time to my code?  
:
:oldpri = SetTaskPri(FindTask(0L),newpri);
:/* do your stuff here */
:SetTaskPri(FindTask(0L),oldpri); /* reset priority */
:
:
:
:
:      (__)    Lauri Aalto
:    w \@@/    [email-masked]
:     `/v/-e   2:228/406.2@fidonet
:    _/  \_    ...Intel inside--idiot outside...

    Be careful... the Amiga only round-robins processes running at the
    same priority, if you set your priority higher your process can
    take ALL the available cpu, locking out everything else.  Most
    processes run at priority 0, setting yours to priority 1 is usually
    sufficient if you need extra CPU, but even that will lock out (while
    you are not blocked waiting for something) all other user processes.
    It doesn't block out the filesystem code or input.device... you have
    to up your priority to 20 or more to do that, but it blocks out enough
    to make the machine unusable if your process gets into an infinite
    loop at that priority.

						-Matt

-- 

    Matthew Dillon		[email-masked]
    1005 Apollo Way
    Incline Village, NV. 89451	ham: KC6LVW (no mail drop)
    USA 			Sandel-Avery Engineering (702)831-8000
    [always include a portion of the original email in any response!]